<script setup>

import CostomerCascaderVue from '../cascader/index.vue'
import {HTTP as SERVICE } from "@/tools";
import { ref } from 'vue';
defineProps({
    modelValue: Array
})
defineEmits(['update:modelValue'])
const CascaderVueInstance = ref(null)

defineExpose(CascaderVueInstance)
/**
 * 系统菜单树，用于给角色授权时选择
 * @returns 
 */
const activeApp = sessionStorage.getItem('activeApp')
async function getAddressInfo() {
    return SERVICE.post('/sysMenu/list', { application: activeApp })
}
</script>
<template>
    <CostomerCascaderVue ref="CascaderVueInstance" :show-all-levels="false"
        :props="{ multiple: true, expandTrigger: 'hover', checkStrictly: true, emitPath: false, label: 'name', value: 'id' }"
        :model-value="modelValue" @update:model-value="$emit('update:modelValue', $event)" v-bind="$attrs"
        :fetchfunc="getAddressInfo" clearable />
</template>